package com.zwxbc.funplay.service.impl;

import com.zwxbc.funplay.dao.DeveloperDao;
import com.zwxbc.funplay.dao.impl.DeveloperDaoImpl;
import com.zwxbc.funplay.entity.Developer;
import com.zwxbc.funplay.service.DeveloperService;

import java.util.List;

/**
 * @author Liubuzhu
 */
public class DeveloperServiceImpl implements DeveloperService {
	DeveloperDao developerDao = new DeveloperDaoImpl();
	@Override
	public Developer developerLogin(Developer developer) {
		return developerDao.developerLogin(developer);
	}

	@Override
	public List<Developer> getDeveloperList() {
		return developerDao.getAllDevelopers();
	}

	@Override
	public boolean deleteDeveloper(Long developerId) {
		int result = developerDao.deleteDeveloper(developerId);
		return result > 0;
	}

	@Override
	public boolean updateDeveloper(Developer developer) {
		int result = developerDao.updateDeveloper(developer);
		return result > 0;
	}

	@Override
	public boolean addDeveloper(Developer developer) {
		int result = developerDao.addDeveloper(developer);
		return result > 0;
	}

	@Override
	public boolean isDeveloperExists(String username, String contact, String email) {
		return developerDao.isDeveloperExists(username, contact, email);
	}

	@Override
	public Developer getDeveloperById(Long developerId) {
		return developerDao.getDeveloperById(developerId);
	}
}
